package com.jsgt.greekfire.ui.main.activation

import com.fhx.core.base.BaseActivity
import com.jsgt.greekfire.IS_ACTIVATION
import com.jsgt.greekfire.R
import com.jsgt.greekfire.ui.main.activation.fragment.ActivatedFragment
import com.jsgt.greekfire.ui.main.activation.fragment.ActivationFragment

class ActivationActivity : BaseActivity() {

    override fun getLayoutId(): Int {
        return R.layout.activity_activation
    }

    override fun main() {
        title = getString(R.string.cloud_activation)
        if (IS_ACTIVATION == 1) {
            val activationFragment = ActivationFragment.newInstance("", "")
            activationFragment.onSuccess = {
                supportFragmentManager.beginTransaction()
                    .replace(R.id.fragment_container, ActivatedFragment.newInstance("", ""))
                    .commit()
            }
            supportFragmentManager.beginTransaction()
                .add(R.id.fragment_container, activationFragment)
                .commit()
        } else {
            supportFragmentManager.beginTransaction()
                .add(R.id.fragment_container, ActivatedFragment.newInstance("", ""))
                .commit()
        }
    }
}